home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BMUG Revelations
/
BMUG Revelations.toast
/
Programming
/
Programming Languages
/
Yerk 3.64
/
Asm source
/
2d-array
next >
Wrap
Text File
|
1991-06-16
|
484b
|
24 lines
\ general 2 dimensional array class. Want this to be in the dictionary
\ since it is pre-loaded with values
:CLASS 2dArray <super array
int xlimit
int ylimit
:M xlimit: get: xlimit ;M
:M yLimit: get: ylimit ;M
( i j -- n )
:M ^ELEM: get: xlimit * + 4* ixaddr: self + ;M
( 0.66 msec )
:M AT: ^elem: self @ ;M
( .60 msec )
:M TO: ^elem: self ! ;M
:M CLASSINIT: { x \ y -- } limit: self -> y
x put: xlimit y put: ylimit
x y * dup ^base 6 + w! y - 4* reserve ;M
;CLASS